#pragma once
//#include <windows.h>
#include <string>
#include "FileAttributes.h"
#include "gstring.h"
using namespace std;
class DirectoryEntry:public FileAttributes
{
public:
	DirectoryEntry();
	~DirectoryEntry();
	gstring FileName;
	/// <summary>
	/// last write time in seconds.
	/// </summary>
	INT64 LastWriteTime;
	/// <summary>
	/// The size of the file in bytes.
	/// </summary>
	INT64 nFileSize;
	
	/// <summary>
	/// Compare two items for sorting. For use with qsort.
	/// </summary>
	/// <param name="item1">First directory entry</param>
	/// <param name="item2">Second directory entry</param>
	/// <returns>-1 or 0 or 1</returns>
	static int SortCompare(const DirectoryEntry* item1, const DirectoryEntry* item2); // I am aware of overriding the <=> operator, but that does not compile with this compiler.
	/// <summary>
	/// Used to compare file names during sorting and searching.
	/// </summary>
	/// <param name="file1">First file</param>
	/// <param name="file2">Second file</param>
	/// <returns>Returns -1 if file1 < file2. Returns 0 if file1 == file2. Returns 1 if file1 > file2.</returns>
	static int CompareFileNames(const gstring *file1, const gstring *file2); 
};
